CREATE TABLE [dbo].[TMCNTA_BANC]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_BANC] [dbo].[TD_VC_003] NOT NULL,
[NU_CNTA_BANC] [dbo].[TD_VC_020] NOT NULL,
[DE_CNTA_BANC] [dbo].[TD_VC_050] NOT NULL,
[CO_TIPO_CNTA] [dbo].[TD_VC_003] NOT NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[CO_AGEN] [dbo].[TD_VC_003] NOT NULL,
[DE_ENTI] [dbo].[TD_VC_100] NULL,
[CO_ENTI] [dbo].[TD_VC_020] NULL,
[TI_NUME_CHEQ] [dbo].[TD_VC_001] NULL CONSTRAINT [DF__TMCNTA_BA__TI_NU__37B03374] DEFAULT ('G'),
[TI_CORR_INEG] [dbo].[TD_VC_001] NULL,
[SI_EMIS_CHEQ] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMCNTA_BA__SI_EM__39987BE6] DEFAULT ('N'),
[TI_SITU] [dbo].[TD_VC_003] NOT NULL,
[CO_CNTA_EMPR] [dbo].[TD_VC_020] NULL,
[SA_PROV_DEBE] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TMCNTA_BA__SA_PR__3B80C458] DEFAULT ((0)),
[SA_PROV_HABE] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TMCNTA_BA__SA_PR__3C74E891] DEFAULT ((0)),
[CO_CNTA_AUXI] [dbo].[TD_VC_020] NULL,
[ST_SOLI_CHEQ] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMCNTA_BA__ST_SO__3D690CCA] DEFAULT ('N'),
[CO_CNTA_ITRB] [dbo].[TD_VC_030] NULL,
[CO_SWIF] [dbo].[TD_VC_008] NULL,
[ST_COMP_INDI] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMCNTA_BA__ST_CO__3F51553C] DEFAULT ('N'),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMCNTA_BA__CO_US__41399DAE] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMCNTA_BA__FE_US__422DC1E7] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TMCNTA_BA__CO_US__4321E620] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMCNTA_BA__FE_US__44160A59] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMCNTA_BANC] WITH NOCHECK ADD CONSTRAINT [CK__TMCNTA_BA__SI_EM__3A8CA01F] CHECK NOT FOR REPLICATION (([SI_EMIS_CHEQ]='N' OR [SI_EMIS_CHEQ]='S'))
GO
ALTER TABLE [dbo].[TMCNTA_BANC] WITH NOCHECK ADD CONSTRAINT [CK__TMCNTA_BA__ST_CO__40457975] CHECK NOT FOR REPLICATION (([ST_COMP_INDI]='N' OR [ST_COMP_INDI]='S'))
GO
ALTER TABLE [dbo].[TMCNTA_BANC] WITH NOCHECK ADD CONSTRAINT [CK__TMCNTA_BA__ST_SO__3E5D3103] CHECK NOT FOR REPLICATION (([ST_SOLI_CHEQ]='N' OR [ST_SOLI_CHEQ]='S'))
GO
ALTER TABLE [dbo].[TMCNTA_BANC] WITH NOCHECK ADD CONSTRAINT [CK__TMCNTA_BA__TI_NU__38A457AD] CHECK NOT FOR REPLICATION (([TI_NUME_CHEQ]='G' OR [TI_NUME_CHEQ]='D'))
GO
ALTER TABLE [dbo].[TMCNTA_BANC] ADD CONSTRAINT [PK__TMCNTA_B__194901EE35F2D38B] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_BANC], [NU_CNTA_BANC]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMCNTA_BANC] ADD CONSTRAINT [FK__TMCNTA_BANC__750425CE] FOREIGN KEY ([CO_BANC], [CO_AGEN]) REFERENCES [dbo].[TTBANC_AGEN] ([CO_BANC], [CO_AGEN])
GO
ALTER TABLE [dbo].[TMCNTA_BANC] ADD CONSTRAINT [FK__TMCNTA_BA__CO_EM__75F84A07] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
